void prints(char* s)
{
	while ((*s) != 0)
	{
		putc(*(s++));
	}
}

void gets(char* s)
{
	char* curChar = s;
	do
	{
		*curChar = getc();
		putc(*curChar);
	} while ((*(curChar++)) != '\r');
	(*(curChar - 1)) = '\0';
}

void main()
{
	char buf[10];
	while (1)
	{
		prints("What's your name? ");
		gets(buf);
		if (buf[0] == '\0')
		{
			prints("\r\nBye Bye!");
			break;
		}
		else
		{
			prints("\nWelcome, ");
			prints(buf);
			prints("!\r\n");
		}	
	}
}
